package com.qianyu.project.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.qianyu.project.entity.SystemRole;
import com.qianyu.project.mapper.SystemRoleMapper;
import com.qianyu.project.service.ISystemRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;

/**
 * @author gs
 * @date create in 2020/12/24 8:21
 */
@Transactional(rollbackFor = Exception.class)
@Service
public class SystemRoleServiceImpl implements ISystemRoleService {

    @Autowired
    private SystemRoleMapper systemRoleMapper;

    @Override
    public List<SystemRole> getByUser(Long id) {
        return systemRoleMapper.selectByUser(id);
    }

    @Override
    public List<SystemRole> list2() {
        return systemRoleMapper.selectList(new QueryWrapper<SystemRole>().eq("role_status", "Y"));
    }
}
